package com.javafactroy.kunlong.test.batch;

import com.javafactroy.kunlong.DbAgent;
import com.javafactroy.kunlong.framework.batch.JobRunner;
import com.javafactroy.kunlong.codefactroy.iface.ICodeTemplate;
import com.javafactroy.kunlong.codefactroy.iface.IStringTemplate;
import com.javafactroy.kunlong.data.dao.mysql.MysqlColumnsMapper;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.util.function.Function;

@SpringBootTest(classes = {DbAgent.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.MethodName.class)

public class TestSpringBatch {
    @Autowired
    MysqlColumnsMapper mysqlColumnsMapper;


    @Autowired
    JobRunner jobRunner;
     //vvHubShopContractsService
    @Test
    public void test001_batch() throws Exception {

        jobRunner.run();
    }

    public static void main(String[] args) {
        ICodeTemplate i = () -> {
            log.info("111");
            return "";
        };

        IStringTemplate.test();
        Function<String, String> f = a -> a;
        log.info("{}", f.apply("111"));
        log.info("{}", StringUtil.capitalize("adddd"));

    }

}
